package kr.co.onc.controller;

import javax.servlet.http.HttpServletRequest;

import kr.co.onc.common.BaseController;
import kr.co.onc.service.OrderService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class OrderController  extends BaseController{

	@Autowired
	private OrderService orderService;
	
	
	@RequestMapping ( value = {"Order/List", "Order/List-aJax"} )
	public String orderList( HttpServletRequest request,Model model,@RequestParam ( value = "isAjax", defaultValue = "false" ) boolean isAjax){

	if ( isAjax ) {
		return "order/orderList-ajax";
	} else {
		return "order/orderList";
	}
	
	}
	
	@RequestMapping ( value = {"Order/OrderInsert", "Order/OrderInsert-aJax"} )
	public String orderInsert( HttpServletRequest request,Model model,@RequestParam ( value = "isAjax", defaultValue = "false" ) boolean isAjax){

		
		
		
	if ( isAjax ) {
		return "order/orderList-ajax";
	} else {
		model.addAttribute("message", REDIRECT);
		model.addAttribute("path", "Customer/List"+CUSTOMER_MENUCODE);
		
		return "common/result";
	}
	
	}
	
	
}
